#1
length = float(input("请输入矩形长度："))
width = float(input("请输入矩形宽度："))
area = length * width
print(f"矩形面积为：{area:.2f}")
#print("矩形面积为:{:.2f}".format(area))
#print("矩形面积为：%.2f" % area)

# **解析**：
# - 使用`input()`接收用户输入，转为浮点型
# - 面积计算公式：`面积 = 长 × 宽`
# - `:.2f`控制输出保留两位小数

print('\n')

#2
total_seconds = int(input("请输入秒数："))
hours = total_seconds // 3600
minutes = (total_seconds % 3600) // 60
seconds = total_seconds % 60
print(f"{hours:02}:{minutes:02}:{seconds:02}")
print('\n')

#3
a=1
b=2
c=3
d=0
print(a>b and b>c or a+b<c) #a>b为False，b>c为False，False or False为False
print(a-b<c or b>c and  not c) #a-b<c为True，b>c为False，True or False为True
print(not d or b>c+a or a) #not d为True，b>c+a为False，True or a为True
print(d and b and c>d and a*b>c) #d为False，False and b为False，False and c>d为False，False and a*b>c为False
print(not (a>b and c>d))   #a>b为False，c>d为True，False and True为False，not False为True
print(a*b>c or b+c>d and  not d) #a*b>c为False，b+c>d为True，False and not d为False，False or False为False
print(c+d<=b+d and d<c or 2*b>c) #c+d<=b+d为false，d<c为True，False or 2*b>c为True
print(d<b or c>a+b+d and b<c+a) #d<b为True，c>a+b+d为False，True and b<c+a为True

print('\n')

#3.x在区间[-5,0]内
x = 3
print(5 <= x <= 0)  # Python独特区间表达式写法
print(x >= -5 and x <= 0)  # 传统逻辑运算符写法

print('\n')

#5.表达式求值 (a=1, b=2, c=3, x=3, y=3)
a = 1
b = 2
c = 3
x = 4
y = 3

print(a+b>c and b==c) # False and False
print(not a<b and b !=c or x+y<=3) # True and True or False
print(a+(b>=x+y) and c-a and y-x) # a+(b>=x+y)是flase，flase and c-a是2，2 and y-x是-1
print (not (x == a) and (y == b) and 0) # True and False and 0
print(not(a+b) + c - 1 and b+c/2) # not (a + b) 的结果是 False 。0+2 and 2+3/2
print(a or 1+'a' and b and 'c') # 1 or 'a' and 2 and 'c

